package lxy;

import java.util.Scanner;

public class Workt5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入第一个数:" );
        int  num1 = sc.nextInt();
        System.out.println("输入第二个数:" );
        int  num2 = sc.nextInt();
        int num = 0;
        for (int i = 1; i < Math.min(num1,num2); i++) {
            if (num1%i == 0 && num2%i == 0){
                num = i;
            }
        }
        System.out.println(num);
    }
}
